UNPKG

pulse-dashboard

Version:

A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions, based on playwright-pulse-report. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI too

4 lines (3 loc) 4.91 kB
module.exports=[24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}. Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},22918,a=>{"use strict";var b=a.i(37936),c=a.i(24868),d=a.i(14747);async function e(){console.log("[ACTIONS getRawHistoricalReports] ------------- START -------------");let a=process.env.PULSE_USER_CWD,b=process.env.PULSE_REPORT_DIR,e=process.cwd();console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_USER_CWD:",a),console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_REPORT_DIR:",b),console.log("[ACTIONS getRawHistoricalReports] process.cwd():",e);let f=a&&""!==a.trim()?a.trim():e,g=b&&""!==b.trim()?b.trim():d.default.join(f,"pulse-report");console.log("[ACTIONS getRawHistoricalReports] Effective baseDir determined:",f),console.log("[ACTIONS getRawHistoricalReports] Effective reportDir determined:",g);let h=d.default.join(g,"history");console.log("[ACTIONS getRawHistoricalReports] Attempting to read history directory:",h);try{let a=(await c.default.readdir(h)).filter(a=>a.startsWith("trend-")&&a.endsWith(".json"));console.log(`[ACTIONS getRawHistoricalReports] Found ${a.length} trend files in ${h}`);let b=[];for(let e of a){let a=d.default.join(h,e);try{let d=await c.default.readFile(a,"utf-8"),f=JSON.parse(d);f.run&&f.results?(void 0===f.run.flakinessRate&&(f.run.flakinessRate=0),b.push(f)):console.warn(`[ACTIONS getRawHistoricalReports] Skipping invalid historical report file (missing run or results): ${e}`)}catch(a){console.error(`[ACTIONS getRawHistoricalReports] Error reading or parsing historical file ${e}:`,a)}}return b.sort((a,b)=>new Date(a.run.timestamp).getTime()-new Date(b.run.timestamp).getTime()),console.log("[ACTIONS getRawHistoricalReports] ------------- END (SUCCESS) -------------"),b}catch(a){return console.error(`[ACTIONS getRawHistoricalReports] Error accessing or reading historical trends directory ${h}:`,a.message),a instanceof Error&&"ENOENT"===a.code&&console.warn(`[ACTIONS getRawHistoricalReports] History directory not found at ${h}. This is normal if no historical reports exist yet.`),console.log("[ACTIONS getRawHistoricalReports] ------------- END (ERROR) -------------"),[]}}async function f(){try{let a=await e();if(0===a.length)return console.log("[ACTIONS getFlakyTestsAnalysis] No historical reports found or an error occurred in getRawHistoricalReports. Returning empty flaky tests."),{success:!0,flakyTests:[]};let b=new Map;for(let c of a){if(!c.results){console.warn("[ACTIONS getFlakyTestsAnalysis] Skipping a report in history due to missing .results property.");continue}for(let a of c.results)b.has(a.id)||b.set(a.id,{name:a.name,suiteName:a.suiteName,occurrences:[]}),b.get(a.id).occurrences.push({runTimestamp:c.run.timestamp,status:a.status})}let c=[];for(let[a,d]of b.entries()){let b=new Set(d.occurrences.map(a=>a.status)),e=b.has("passed"),f=b.has("failed")||b.has("timedOut");if(e&&f){let b=0,e=0,f=0,g=0;d.occurrences.forEach(a=>{"passed"===a.status?b++:"failed"===a.status||"timedOut"===a.status?e++:"skipped"===a.status?f++:"pending"===a.status&&g++});let h=d.occurrences.sort((a,b)=>new Date(a.runTimestamp).getTime()-new Date(b.runTimestamp).getTime());c.push({id:a,name:d.name,suiteName:d.suiteName,occurrences:h,passedCount:b,failedCount:e,skippedCount:f,pendingCount:g,totalRuns:d.occurrences.length,firstSeen:h[0]?.runTimestamp||"",lastSeen:h[h.length-1]?.runTimestamp||""})}}return c.sort((a,b)=>b.failedCount/b.totalRuns-a.failedCount/a.totalRuns||b.totalRuns-a.totalRuns),{success:!0,flakyTests:c}}catch(a){return console.error("[ACTIONS getFlakyTestsAnalysis] Error analyzing flaky tests:",a),{success:!1,error:a instanceof Error?a.message:"An unknown error occurred during flaky test analysis."}}}(0,a.i(13095).ensureServerEntryExports)([e,f]),(0,b.registerServerReference)(e,"00eb0c3664b06d971aaa7dd2c76b9b0f9440b9dbb2",null),(0,b.registerServerReference)(f,"008fa02e9805f6239c3ac102767cce196a0538ded4",null),a.s(["getFlakyTestsAnalysis",()=>f,"getRawHistoricalReports",()=>e])},97718,a=>{"use strict";var b=a.i(22918);a.s([],87336),a.i(87336),a.s(["00eb0c3664b06d971aaa7dd2c76b9b0f9440b9dbb2",()=>b.getRawHistoricalReports],97718)}]; //# sourceMappingURL=%5Broot-of-the-server%5D__71dd9d42._.js.map